package com.learn.strategy;

/**
 * <p>项目名称: design-pattern </p>
 *
 * <p>文件名称: DragonSlayer </p>
 *
 * 屠龙--使用不同策略
 */
public class DragonSlayer {

    private DragonSlayingStrategy strategy;

    public DragonSlayer(DragonSlayingStrategy strategy) {
        this.strategy = strategy;
    }

    public void changeStrategy(DragonSlayingStrategy strategy) {
        this.strategy = strategy;
    }

    public void battle(){
        strategy.execute();
    }

}
